package org.ciallo.simplemusicplayer.util;

/**
 * @author Jukomu
 * @Description:
 * @Package: org.ciallo.simplemusicplayer.util
 * @Project: SimpleMusicPlayer
 * @name: Constants
 * @Date: 2025/5/28-21:25
 * @Filename: Constants
 */
public class Constants {
    // 播放模式
    public static final int PLAY_MODE_ORDER = 0;       // 顺序播放
    public static final int PLAY_MODE_SHUFFLE = 1;     // 随机播放
    public static final int PLAY_MODE_SINGLE_LOOP = 2; // 单曲循环
    public static final int PLAY_MODE_LIST_LOOP = 3;   // 列表循环
    public static final int PLAY_MODE_COUNT = 4; // 播放模式的总数

    // MediaPlayerService Actions
    public static final String ACTION_PLAY_SONG_AT_INDEX = "org.ciallo.simplemusicplayer.ACTION_PLAY_SONG_AT_INDEX"; // 用于播放指定索引的歌曲，并可附带新队列
    public static final String ACTION_SET_PLAY_QUEUE = "org.ciallo.simplemusicplayer.ACTION_SET_PLAY_QUEUE"; // 专门用于设置或更新播放队列
    public static final String ACTION_TOGGLE_PLAY_PAUSE = "org.ciallo.simplemusicplayer.ACTION_TOGGLE_PLAY_PAUSE";
    public static final String ACTION_SEEK_TO = "org.ciallo.simplemusicplayer.ACTION_SEEK_TO";
    public static final String ACTION_NEXT_SONG = "org.ciallo.simplemusicplayer.ACTION_NEXT_SONG";
    public static final String ACTION_PREVIOUS_SONG = "org.ciallo.simplemusicplayer.ACTION_PREVIOUS_SONG";
    public static final String ACTION_SET_PLAY_MODE = "org.ciallo.simplemusicplayer.ACTION_SET_PLAY_MODE";
    public static final String ACTION_STOP_SERVICE = "org.ciallo.simplemusicplayer.ACTION_STOP_SERVICE";
    public static final String ACTION_REMOVE_SONG_FROM_QUEUE = "org.ciallo.simplemusicplayer.ACTION_REMOVE_SONG_FROM_QUEUE"; // 用于从队列移除歌曲
    public static final String ACTION_CLEAR_QUEUE = "org.ciallo.simplemusicplayer.ACTION_CLEAR_QUEUE"; // 用于清空队列
    public static final String ACTION_PLAY_SPECIFIC_SONG_ID_IN_QUEUE = "org.ciallo.simplemusicplayer.ACTION_PLAY_SPECIFIC_SONG_ID_IN_QUEUE"; // 播放特定ID的歌曲
    public static final String ACTION_PLAY_IMMEDIATELY = "org.ciallo.simplemusicplayer.ACTION_PLAY_IMMEDIATELY"; // 用于立即播放指定歌曲
    public static final String ACTION_INSERT_SONG_AS_NEXT_IN_QUEUE = "org.ciallo.simplemusicplayer.ACTION_INSERT_SONG_AS_NEXT_IN_QUEUE"; // 用于插入到下一首播放（不立即打断）
    public static final String ACTION_ADD_SONG_TO_END_OF_QUEUE = "org.ciallo.simplemusicplayer.ACTION_ADD_SONG_TO_END_OF_QUEUE"; // 用于添加到队列末尾（不立即打断）

    // Intent Extras
    public static final String EXTRA_SONG_OBJECT = "extra_song_object"; // 用于传递单个Song对象
    public static final String EXTRA_PLAY_QUEUE = "extra_play_queue"; // 用于传递 List<Song>
    public static final String EXTRA_START_INDEX = "extra_start_index"; // 用于指定播放起始索引
    public static final String EXTRA_PLAY_MODE = "extra_play_mode";
    public static final String EXTRA_SEEK_POSITION = "extra_seek_position";
    public static final String EXTRA_SONG_ID_TO_REMOVE = "extra_song_id_to_remove";
    public static final String EXTRA_SONG_ID = "extra_song_id"; // 用于传递要播放的歌曲ID

    // SharedPreferences Keys
    public static final String PREF_NAME = "SimpleMusicPlayerPrefs";
    public static final String PREF_KEY_ORIGINAL_QUEUE_JSON = "pref_original_queue_json";
    public static final String PREF_KEY_SHUFFLED_QUEUE_JSON = "pref_shuffled_queue_json";
    public static final String PREF_KEY_CURRENT_SONG_ID = "pref_current_song_id";
    public static final String PREF_KEY_ORIGINAL_QUEUE_INDEX = "pref_original_queue_index";
    public static final String PREF_KEY_PLAY_MODE = "pref_play_mode";
    public static final String PREF_KEY_LAST_POSITION = "pref_last_position";
    public static final String PREF_KEY_QUEUE = "pref_queue";
    public static final String PREF_KEY_SHUFFLED_QUEUE = "pref_shuffled_queue";
    public static final String PREF_KEY_CURRENT_INDEX = "pref_current_index"; // 指向 originalPlayQueue 的索引

    // 通知相关
    public static final String NOTIFICATION_CHANNEL_ID = "simple_music_player_channel";
    public static final String NOTIFICATION_CHANNEL_NAME = "Simple Music Player Controls";
    public static final int NOTIFICATION_ID_PLAYER = 1001;

    // 其他常量
    public static final String UNKNOWN_STRING = "<unknown>";
    public static final int INVALID_INDEX = -1; // 无效索引
    public static final long FAVORITES_PLAYLIST_ID = -100L;
    public static final int RECENT_PLAY_LIST_LIMIT = 100; // 例如，最近播放列表上限为100首
}
